var os = require('os');
var _ = require('lodash');
var yargs = require('yargs');
var notes = require('./nodes');

var user = os.userInfo();
// console.log(user);

// console.log(_.isString(true));
// console.log(_.isString('tony'));

var filteredArray = _.uniq(['tony', 1, 'tony', 1, 2, 3, 4]);
console.log(filteredArray);
// require('fs')

// console.log(process.argv);

var commond = process.argv[2];


var argv = yargs.argv;
commond = argv._[0];


console.log('process', process.argv);
console.log("yargs", argv);

console.log('Command:', commond);

if (commond === 'add') {
    notes.addNote(argv.title, argv.body);
} else if (commond === 'list') {
    notes.getAll();
} else if (commond === 'read') {
    notes.getNote(argv.title);
} else if (commond === 'remove') {
    notes.removeNote(argv.title);
} else {
    console.log('Commond not recognized');
}
